/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.aqlm.data;

import java.util.List;
import org.rainbow.annotation.xml.NodeAttr;
import org.rainbow.annotation.xml.ParentAttr;

/**
 *
 * @author hironaga
 */
public class MailSettingUDO{

    @ParentAttr( attrName="type" )
    private String type;

//    private String host;

    @NodeAttr( elementName="smtp-host-address", attrName="value" )
    private String smtpHostAddress;

    @NodeAttr( elementName="smtp-host-port", attrName="value" )
    private String smtpHostPort;

    @NodeAttr(elementName="smtp-mail-address", attrName="value")
    private String smtpMailAddress;

    @NodeAttr(elementName="smtp-id", attrName="value")
    private String smtpId;

    @NodeAttr(elementName="smtp-pw", attrName="value")
    private String smtpPw;

    @NodeAttr(elementName="sender", attrName="value")
    private String sender;

    @NodeAttr(elementName="send-to-address", attrName="value")
    private List<String> sendToAddress;

    @NodeAttr(elementName="send-cc-address", attrName="value")
    private List<String> sendCcAddress;

    @NodeAttr(elementName="send-bcc-address", attrName="value")
    private List<String> sendBccAddress;

    @NodeAttr(elementName="title", attrName="value")
    private String tittle;
    

    @Override
    public String toString() {
        
        StringBuffer sb = new StringBuffer();
        
        for (String st : getSendToAddress()) {
            sb.append("sendToAddress: ");
            sb.append(st);
        }
        for (String st : getSendCcAddress()) {
            sb.append("sendCcAddress: ");
            sb.append(st);
        }       
        for (String st : getSendBccAddress()) {
            sb.append("sendBccAddress: ");
            sb.append(st);
        }
        return //super.toString()+
                "type" + getType() +
//                "host" + getHost() +
                "smtpHostAddress: " + getSmtpHostAddress() +
                "smtpHostPort: " + getSmtpHostPort() +
                "smtpMailAddress: " + getSmtpMailAddress() +
                "smtpId: " + getSmtpId() +
                "smtpPw: " + getSmtpPw() +
                "sender: " + getSender() + 
                sb.toString();
    }
    
    //setter overload
    public void setSendToAddress(String sendToAddress) {
        this.sendToAddress.add(sendToAddress);
    }
    public void setSendBccAddress(String sendBccAddress) {
        this.sendBccAddress.add(sendBccAddress);
    }
    public void setSendCcAddress(String sendCcAddress) {
        this.sendCcAddress.add(sendCcAddress);
    }
    
    
    public List<String> getSendBccAddress() {
        return sendBccAddress;
    }

    public void setSendBccAddress(List<String> sendBccAddress) {
        this.sendBccAddress = sendBccAddress;
    }

    public List<String> getSendCcAddress() {
        return sendCcAddress;
    }

    public void setSendCcAddress(List<String> sendCcAddress) {
        this.sendCcAddress = sendCcAddress;
    }

    public List<String> getSendToAddress() {
        return sendToAddress;
    }

    public void setSendToAddress(List<String> sendToAddress) {
        this.sendToAddress = sendToAddress;
    }

//    public String getHost() {
//        return host;
//    }
//
//    public void setHost(String host) {
//        this.host = host;
//    }

    public String getSender() {
        return sender;
    }

    public void setSender(String sender) {
        this.sender = sender;
    }

    public String getSmtpHostAddress() {
        return smtpHostAddress;
    }

    public void setSmtpHostAddress(String smtpHostAddress) {
        this.smtpHostAddress = smtpHostAddress;
    }

    public String getSmtpHostPort() {
        return smtpHostPort;
    }

    public void setSmtpHostPort(String smtpHostPort) {
        this.smtpHostPort = smtpHostPort;
    }

    public String getSmtpId() {
        return smtpId;
    }

    public void setSmtpId(String smtpId) {
        this.smtpId = smtpId;
    }

    public String getSmtpMailAddress() {
        return smtpMailAddress;
    }

    public void setSmtpMailAddress(String smtpMailAddress) {
        this.smtpMailAddress = smtpMailAddress;
    }

    public String getSmtpPw() {
        return smtpPw;
    }

    public void setSmtpPw(String smtpPw) {
        this.smtpPw = smtpPw;
    }

    public String getTittle() {
        return tittle;
    }

    public void setTittle(String tittle) {
        this.tittle = tittle;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

}
